<?php 
    $keywords = $this->get_data('keywords');
?>
<?php if ($keywords):?>
<ul>
<?php foreach ($keywords as $keyword) :?>
<?php foreach(m('node')->model('node')->get_nodes_by_keyword_id($keyword['id']) as $node):?>
<li><a href="javascript:;" onclick="add_link('<?php echo $node['url_segment'];?>'); return false;">
    <?php echo tos_img($node['thumbnail'], 20, 20);?><?php echo $node['caption'];?>
</a></li>
<?php endforeach;?>
<?php endforeach;?>
</ul>
<?php endif;?>